package com.jc.service.enums;

import com.jc.framework.enums.OrderStatus;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrderStatusServiceImpl implements OrderStatusService {
    @Override
    public Map<String,Object> queryAll(Map<String,Object> param) {
        List<Map<String,String>> resultList = new ArrayList<>();
        for (OrderStatus orderStatus : OrderStatus.values()) {
            resultList.add(new HashMap<String, String>(){{
                put("key",orderStatus.getName());
                put("value",orderStatus.getDesc());
            }});
        }
        return new HashMap<String, Object>(){{
            put("code",10000);
            put("data",resultList);
            put("msg","");
        }};
    }
}
